import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 引入element
import './plugins/element.js'
// import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// Vue.use(ElementUI)
//引入全局css
import './assets/css/main.css'
//引入字体图标
import './assets/fonts/iconfont.css'
//导入树状表格
import ZkTable from 'vue-table-with-tree-grid'
import VueQuillEditor from 'vue-quill-editor'

import { Message, MessageBox } from "element-ui"
Vue.prototype.$mg = Message
Vue.prototype.$cfm = MessageBox.confirm

import axios from 'axios'
// import VueAxios  from 'vue-axios'

// Vue.use(VueAxios,axios)
// 设置默认地址
// axios.defaults.baseURL = 'http://53.64.8.11:8090/'
axios.defaults.baseURL = 'http://192.168.8.154:8090/'
    // axios.defaults.baseURL = 'http://53.64.8.12:1521/orcl/'

// 设置拦截器,方便直接获取token
axios.interceptors.request.use(config => {
        //   Nprogress.start()
        //       // config 拿到请求的所有信息
        config.headers.Authorization = sessionStorage.getItem('token')
        return config;
    })
    // 响应拦截器
axios.interceptors.response.use(res => {
    // Nprogress.done()
    return res
})

Vue.use(VueQuillEditor, /* { default global options } */ )

Vue.prototype.axios = axios

Vue.config.productionTip = false



Vue.filter('dateFormat', function(time) {
        // debugger
        if (time != null) {
            var date = new Date(time)
            var y = (date.getFullYear() + '').padStart(2, '0')
            var m = (date.getMonth() + 1 + '').padStart(2, '0')
            var d = (date.getDate() + '').padStart(2, '0')
            var H = (date.getHours() + '').padStart(2, '0')
            var M = (date.getMinutes() + '').padStart(2, '0')
            var s = (date.getSeconds() + '').padStart(2, '0')
            return `${y}-${m}-${d}  ${H}:${M}:${s}`
        } else {
            return ''
        }
    })
    //全局注册组件
Vue.component('tree-table', ZkTable)

new Vue({
    router,
    render: h => h(App)
}).$mount('#app')